﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using System.Data;
using System.Data.SqlClient;

namespace BUS
{
    public class TheLoaiBUS
    {
        SqlDataProvider db = new SqlDataProvider();
        public DataTable showTL()
        {
            string sql = "showTL";
            return db.myTable_sp(sql);
        }
        public void themTL(string tentheloai)
        {
            string sql = "themTheLoai";
            SqlParameter Ptentheloai = new SqlParameter("tentheloai", tentheloai);
            db.exe_sp(sql, Ptentheloai);
        }
        public void xoaTL(string matheloai)
        {
            string sql = "xoaTheLoai";
            SqlParameter Pmatheloai = new SqlParameter("matheloai", matheloai);
            db.exe_sp(sql, Pmatheloai);
        }
        public void suaTL(string matheloai,string tentheloai)
        {
            string sql = "suaTheLoai";
            SqlParameter Ptentheloai = new SqlParameter("tentheloai", tentheloai);
            SqlParameter Pmatheloai = new SqlParameter("matheloai", matheloai);
            db.exe_sp(sql, Ptentheloai, Pmatheloai);
        }
    }
}
